package com.uchengwang.ui.cm_ui.cycle.viewHolder;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewStub;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.uchengwang.R;
import com.uchengwang.ui.self.circledemo.widgets.PraiseListView;
import com.uchengwang.ui.view.CommentListView;
import com.uchengwang.ui.view.ExpandTextView;
import com.zhy.autolayout.utils.AutoUtils;


/**
 * Created by yiw on 2016/8/16.
 */
public abstract class CircleViewHolder extends RecyclerView.ViewHolder {

    //1：享说图文 2：投票  3：活动  4：会场  5：享说视频  6：链接  7：文章
    public final static int TYPE_IMAGE = 1;
    public final static int TYPE_VIDEO = 5;
    public final static int TYPE_URL = 6;
    public final static int TYPE_ARTICLE = 7;

    public int viewType;

    public ImageView headIv, like_image, follow_more;
    public TextView nameTv;
    public TextView urlTipTv;
    /** 动态的内容 */
    public ExpandTextView contentTv;
    public TextView timeTv;
    /** 点赞列表*/
    public PraiseListView praiseListView;

    public LinearLayout digCommentBody, cmt_ln;

    /** 评论列表 */
    public CommentListView commentList;
    // ===========================
//    public SnsPopupWindow snsPopupWindow;

    public CircleViewHolder(View itemView, int viewType) {
        super(itemView);
        AutoUtils.auto(itemView);

        this.viewType = viewType;

        ViewStub viewStub =  itemView.findViewById(R.id.viewStub);

        initSubView(viewType, viewStub);

        headIv =  itemView.findViewById(R.id.headIv);
        nameTv =  itemView.findViewById(R.id.nameTv);

        contentTv =  itemView.findViewById(R.id.contentTv);
        timeTv =  itemView.findViewById(R.id.timeTv);
//        praiseListView = (PraiseListView) itemView.findViewById(R.id.praiseListView);

        commentList = itemView.findViewById(R.id.commentList);

        like_image = itemView.findViewById(R.id.follow_like_image);
        cmt_ln = itemView.findViewById(R.id.cmt_ln);

        follow_more = itemView.findViewById(R.id.follow_more);


    }

    public abstract void initSubView(int viewType, ViewStub viewStub);


}
